package engine.utils;

import java.util.Random;

/**
 * This is the Utils class. It will contain simple scripts to make repetitive tasks easier. For
 * example, getting a random integer. Instead of writing the same code 300 times, or implementing
 * several randomInt methods in each class, we can have one randomInt method in the Utils class. In
 * this way it is easy to change any general code that we need to.
 * 
 * @author Kyle_Solo
 */
public class Utils {
	private static Random r = new Random();

	/**
	 * Returns a random integer between low and high. <br>
	 * To roll a six sided die: randomInt(1, 6);
	 * 
	 * @param low
	 *            The lower end of the bounds. Inclusive.
	 * @param high
	 *            The upper end of the bounds. Inclusive.
	 * @return An integer equal to or between low and high.
	 */
	public static int randomInt(int low, int high) {
		return Utils.r.nextInt(high - low + 1) + low;
	}
}
